<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>LCOV - lcov.info.p - core/contracts/protocol/pool/src/core/contracts/protocol/pool/PoolConfigurator.sol</title>
  <link rel="stylesheet" type="text/css" href="../../../../../../../../../gcov.css">
</head>

<body>

          <table width="100%" border=0 cellspacing=0 cellpadding=0>
            <tr><td class="title">LCOV - code coverage report</td></tr>
            <tr><td class="ruler"><img src="../../../../../../../../../glass.png" width=3 height=3 alt=""></td></tr>

            <tr>
              <td width="100%">
                <table cellpadding=1 border=0 width="100%">
          <tr>
            <td width="10%" class="headerItem">Current view:</td>
            <td width="10%" class="headerValue"><a href="../../../../../../../../../index.html">top level</a> - <a href="index.html">core/contracts/protocol/pool/src/core/contracts/protocol/pool</a> - PoolConfigurator.sol<span style="font-size: 80%;"> (source / <a href="PoolConfigurator.sol.func-c.html">functions</a>)</span></td>
            <td width="5%"></td>
            <td width="5%"></td>
            <td width="5%" class="headerCovTableHead">Coverage</td>
            <td width="5%" class="headerCovTableHead" title="Covered + Uncovered code">Total</td>
            <td width="5%" class="headerCovTableHead" title="Exercised code only">Hit</td>
          </tr>
          <tr>
            <td class="headerItem">Test:</td>
            <td class="headerValue">lcov.info.p</td>
            <td></td>
            <td class="headerItem">Lines:</td>
            <td class="headerCovTableEntryHi">96.8&nbsp;%</td>
            <td class="headerCovTableEntry">190</td>
            <td class="headerCovTableEntry">184</td>
          </tr>
          <tr>
            <td class="headerItem">Test Date:</td>
            <td class="headerValue">2024-04-09 14:12:28</td>
            <td></td>
            <td class="headerItem">Functions:</td>
            <td class="headerCovTableEntryHi">94.9&nbsp;%</td>
            <td class="headerCovTableEntry">39</td>
            <td class="headerCovTableEntry">37</td>
          </tr>
          <tr>
            <td></td>
            <td></td>
            <td></td>
            <td class="headerItem">Branches:</td>
            <td class="headerCovTableEntryHi">-</td>
            <td class="headerCovTableEntry">0</td>
            <td class="headerCovTableEntry">0</td>
          </tr>
                  <tr><td><img src="../../../../../../../../../glass.png" width=3 height=3 alt=""></td></tr>
                </table>
              </td>
            </tr>

            <tr><td class="ruler"><img src="../../../../../../../../../glass.png" width=3 height=3 alt=""></td></tr>
          </table>

          <table cellpadding=0 cellspacing=0 border=0>
            <tr>
              <td><br></td>
            </tr>
            <tr>
              <td>
<pre class="sourceHeading">             Branch data     Line data    Source code</pre>
<pre class="source">
<span id="L1"><span class="lineNum">       1</span>                 :             : // SPDX-License-Identifier: BUSL-1.1</span>
<span id="L2"><span class="lineNum">       2</span>                 :             : pragma solidity ^0.8.10;</span>
<span id="L3"><span class="lineNum">       3</span>                 :             : </span>
<span id="L4"><span class="lineNum">       4</span>                 :             : import {VersionedInitializable} from '../libraries/aave-upgradeability/VersionedInitializable.sol';</span>
<span id="L5"><span class="lineNum">       5</span>                 :             : import {ReserveConfiguration} from '../libraries/configuration/ReserveConfiguration.sol';</span>
<span id="L6"><span class="lineNum">       6</span>                 :             : import {IPoolAddressesProvider} from '../../interfaces/IPoolAddressesProvider.sol';</span>
<span id="L7"><span class="lineNum">       7</span>                 :             : import {IDefaultInterestRateStrategyV2} from '../../interfaces/IDefaultInterestRateStrategyV2.sol';</span>
<span id="L8"><span class="lineNum">       8</span>                 :             : import {Errors} from '../libraries/helpers/Errors.sol';</span>
<span id="L9"><span class="lineNum">       9</span>                 :             : import {PercentageMath} from '../libraries/math/PercentageMath.sol';</span>
<span id="L10"><span class="lineNum">      10</span>                 :             : import {DataTypes} from '../libraries/types/DataTypes.sol';</span>
<span id="L11"><span class="lineNum">      11</span>                 :             : import {ConfiguratorLogic} from '../libraries/logic/ConfiguratorLogic.sol';</span>
<span id="L12"><span class="lineNum">      12</span>                 :             : import {ConfiguratorInputTypes} from '../libraries/types/ConfiguratorInputTypes.sol';</span>
<span id="L13"><span class="lineNum">      13</span>                 :             : import {IPoolConfigurator} from '../../interfaces/IPoolConfigurator.sol';</span>
<span id="L14"><span class="lineNum">      14</span>                 :             : import {IPool} from '../../interfaces/IPool.sol';</span>
<span id="L15"><span class="lineNum">      15</span>                 :             : import {IACLManager} from '../../interfaces/IACLManager.sol';</span>
<span id="L16"><span class="lineNum">      16</span>                 :             : import {IPoolDataProvider} from '../../interfaces/IPoolDataProvider.sol';</span>
<span id="L17"><span class="lineNum">      17</span>                 :             : import {IERC20} from '../../dependencies/openzeppelin/contracts/IERC20.sol';</span>
<span id="L18"><span class="lineNum">      18</span>                 :             : import {IERC20Detailed} from '../../dependencies/openzeppelin/contracts/IERC20Detailed.sol';</span>
<span id="L19"><span class="lineNum">      19</span>                 :             : </span>
<span id="L20"><span class="lineNum">      20</span>                 :             : /**</span>
<span id="L21"><span class="lineNum">      21</span>                 :             :  * @title PoolConfigurator</span>
<span id="L22"><span class="lineNum">      22</span>                 :             :  * @author Aave</span>
<span id="L23"><span class="lineNum">      23</span>                 :             :  * @dev Implements the configuration methods for the Aave protocol</span>
<span id="L24"><span class="lineNum">      24</span>                 :             :  */</span>
<span id="L25"><span class="lineNum">      25</span>                 :             : abstract contract PoolConfigurator is VersionedInitializable, IPoolConfigurator {</span>
<span id="L26"><span class="lineNum">      26</span>                 :             :   using PercentageMath for uint256;</span>
<span id="L27"><span class="lineNum">      27</span>                 :             :   using ReserveConfiguration for DataTypes.ReserveConfigurationMap;</span>
<span id="L28"><span class="lineNum">      28</span>                 :             : </span>
<span id="L29"><span class="lineNum">      29</span>                 :             :   IPoolAddressesProvider internal _addressesProvider;</span>
<span id="L30"><span class="lineNum">      30</span>                 :             :   IPool internal _pool;</span>
<span id="L31"><span class="lineNum">      31</span>                 :             : </span>
<span id="L32"><span class="lineNum">      32</span>                 :             :   mapping(address =&gt; uint256) internal _pendingLtv;</span>
<span id="L33"><span class="lineNum">      33</span>                 :             :   mapping(address =&gt; bool) internal _isPendingLtvSet;</span>
<span id="L34"><span class="lineNum">      34</span>                 :             : </span>
<span id="L35"><span class="lineNum">      35</span>                 :             :   uint40 public constant MAX_GRACE_PERIOD = 4 hours;</span>
<span id="L36"><span class="lineNum">      36</span>                 :             : </span>
<span id="L37"><span class="lineNum">      37</span>                 :             :   /**</span>
<span id="L38"><span class="lineNum">      38</span>                 :             :    * @dev Only pool admin can call functions marked by this modifier.</span>
<span id="L39"><span class="lineNum">      39</span>                 :             :    */</span>
<span id="L40"><span class="lineNum">      40</span>                 :             :   modifier onlyPoolAdmin() {</span>
<span id="L41"><span class="lineNum">      41</span>                 :             :     _onlyPoolAdmin();</span>
<span id="L42"><span class="lineNum">      42</span>                 :             :     _;</span>
<span id="L43"><span class="lineNum">      43</span>                 :             :   }</span>
<span id="L44"><span class="lineNum">      44</span>                 :             : </span>
<span id="L45"><span class="lineNum">      45</span>                 :             :   /**</span>
<span id="L46"><span class="lineNum">      46</span>                 :             :    * @dev Only emergency admin can call functions marked by this modifier.</span>
<span id="L47"><span class="lineNum">      47</span>                 :             :    */</span>
<span id="L48"><span class="lineNum">      48</span>                 :             :   modifier onlyEmergencyAdmin() {</span>
<span id="L49"><span class="lineNum">      49</span>                 :             :     _onlyEmergencyAdmin();</span>
<span id="L50"><span class="lineNum">      50</span>                 :             :     _;</span>
<span id="L51"><span class="lineNum">      51</span>                 :             :   }</span>
<span id="L52"><span class="lineNum">      52</span>                 :             : </span>
<span id="L53"><span class="lineNum">      53</span>                 :             :   /**</span>
<span id="L54"><span class="lineNum">      54</span>                 :             :    * @dev Only emergency or pool admin can call functions marked by this modifier.</span>
<span id="L55"><span class="lineNum">      55</span>                 :             :    */</span>
<span id="L56"><span class="lineNum">      56</span>                 :             :   modifier onlyEmergencyOrPoolAdmin() {</span>
<span id="L57"><span class="lineNum">      57</span>                 :             :     _onlyPoolOrEmergencyAdmin();</span>
<span id="L58"><span class="lineNum">      58</span>                 :             :     _;</span>
<span id="L59"><span class="lineNum">      59</span>                 :             :   }</span>
<span id="L60"><span class="lineNum">      60</span>                 :             : </span>
<span id="L61"><span class="lineNum">      61</span>                 :             :   /**</span>
<span id="L62"><span class="lineNum">      62</span>                 :             :    * @dev Only asset listing or pool admin can call functions marked by this modifier.</span>
<span id="L63"><span class="lineNum">      63</span>                 :             :    */</span>
<span id="L64"><span class="lineNum">      64</span>                 :             :   modifier onlyAssetListingOrPoolAdmins() {</span>
<span id="L65"><span class="lineNum">      65</span>                 :             :     _onlyAssetListingOrPoolAdmins();</span>
<span id="L66"><span class="lineNum">      66</span>                 :             :     _;</span>
<span id="L67"><span class="lineNum">      67</span>                 :             :   }</span>
<span id="L68"><span class="lineNum">      68</span>                 :             : </span>
<span id="L69"><span class="lineNum">      69</span>                 :             :   /**</span>
<span id="L70"><span class="lineNum">      70</span>                 :             :    * @dev Only risk or pool admin can call functions marked by this modifier.</span>
<span id="L71"><span class="lineNum">      71</span>                 :             :    */</span>
<span id="L72"><span class="lineNum">      72</span>                 :             :   modifier onlyRiskOrPoolAdmins() {</span>
<span id="L73"><span class="lineNum">      73</span>                 :             :     _onlyRiskOrPoolAdmins();</span>
<span id="L74"><span class="lineNum">      74</span>                 :             :     _;</span>
<span id="L75"><span class="lineNum">      75</span>                 :             :   }</span>
<span id="L76"><span class="lineNum">      76</span>                 :             : </span>
<span id="L77"><span class="lineNum">      77</span>                 :             :   /**</span>
<span id="L78"><span class="lineNum">      78</span>                 :             :    * @dev Only risk, pool or emergency admin can call functions marked by this modifier.</span>
<span id="L79"><span class="lineNum">      79</span>                 :             :    */</span>
<span id="L80"><span class="lineNum">      80</span>                 :             :   modifier onlyRiskOrPoolOrEmergencyAdmins() {</span>
<span id="L81"><span class="lineNum">      81</span>                 :             :     _onlyRiskOrPoolOrEmergencyAdmins();</span>
<span id="L82"><span class="lineNum">      82</span>                 :             :     _;</span>
<span id="L83"><span class="lineNum">      83</span>                 :             :   }</span>
<span id="L84"><span class="lineNum">      84</span>                 :             : </span>
<span id="L85"><span class="lineNum">      85</span>                 :             :   function initialize(IPoolAddressesProvider provider) public virtual;</span>
<span id="L86"><span class="lineNum">      86</span>                 :             : </span>
<span id="L87"><span class="lineNum">      87</span>                 :             :   /// @inheritdoc IPoolConfigurator</span>
<span id="L88"><span class="lineNum">      88</span>                 :<span class="tlaGNC tlaBgGNC">        2592 :   function initReserves(</span></span>
<span id="L89"><span class="lineNum">      89</span>                 :             :     ConfiguratorInputTypes.InitReserveInput[] calldata input</span>
<span id="L90"><span class="lineNum">      90</span>                 :             :   ) external override onlyAssetListingOrPoolAdmins {</span>
<span id="L91"><span class="lineNum">      91</span>                 :<span class="tlaGNC">        5182 :     IPool cachedPool = _pool;</span></span>
<span id="L92"><span class="lineNum">      92</span>                 :<span class="tlaGNC">       13535 :     for (uint256 i = 0; i &lt; input.length; i++) {</span></span>
<span id="L93"><span class="lineNum">      93</span>                 :<span class="tlaGNC">        7764 :       require(IERC20Detailed(input[i].underlyingAsset).decimals() &gt; 5, Errors.INVALID_DECIMALS);</span></span>
<span id="L94"><span class="lineNum">      94</span>                 :             : </span>
<span id="L95"><span class="lineNum">      95</span>                 :<span class="tlaGNC">        5764 :       ConfiguratorLogic.executeInitReserve(cachedPool, input[i]);</span></span>
<span id="L96"><span class="lineNum">      96</span>                 :<span class="tlaGNC">        5762 :       emit ReserveInterestRateDataChanged(</span></span>
<span id="L97"><span class="lineNum">      97</span>                 :             :         input[i].underlyingAsset,</span>
<span id="L98"><span class="lineNum">      98</span>                 :             :         input[i].interestRateStrategyAddress,</span>
<span id="L99"><span class="lineNum">      99</span>                 :             :         input[i].interestRateData</span>
<span id="L100"><span class="lineNum">     100</span>                 :             :       );</span>
<span id="L101"><span class="lineNum">     101</span>                 :             :     }</span>
<span id="L102"><span class="lineNum">     102</span>                 :             :   }</span>
<span id="L103"><span class="lineNum">     103</span>                 :             : </span>
<span id="L104"><span class="lineNum">     104</span>                 :             :   /// @inheritdoc IPoolConfigurator</span>
<span id="L105"><span class="lineNum">     105</span>                 :<span class="tlaGNC">           6 :   function dropReserve(address asset) external override onlyPoolAdmin {</span></span>
<span id="L106"><span class="lineNum">     106</span>                 :<span class="tlaGNC">          10 :     _pool.dropReserve(asset);</span></span>
<span id="L107"><span class="lineNum">     107</span>                 :<span class="tlaGNC">           2 :     emit ReserveDropped(asset);</span></span>
<span id="L108"><span class="lineNum">     108</span>                 :             :   }</span>
<span id="L109"><span class="lineNum">     109</span>                 :             : </span>
<span id="L110"><span class="lineNum">     110</span>                 :             :   /// @inheritdoc IPoolConfigurator</span>
<span id="L111"><span class="lineNum">     111</span>                 :<span class="tlaGNC">           2 :   function updateAToken(</span></span>
<span id="L112"><span class="lineNum">     112</span>                 :             :     ConfiguratorInputTypes.UpdateATokenInput calldata input</span>
<span id="L113"><span class="lineNum">     113</span>                 :             :   ) external override onlyPoolAdmin {</span>
<span id="L114"><span class="lineNum">     114</span>                 :<span class="tlaGNC">           2 :     ConfiguratorLogic.executeUpdateAToken(_pool, input);</span></span>
<span id="L115"><span class="lineNum">     115</span>                 :             :   }</span>
<span id="L116"><span class="lineNum">     116</span>                 :             : </span>
<span id="L117"><span class="lineNum">     117</span>                 :             :   /// @inheritdoc IPoolConfigurator</span>
<span id="L118"><span class="lineNum">     118</span>                 :<span class="tlaGNC">           2 :   function updateStableDebtToken(</span></span>
<span id="L119"><span class="lineNum">     119</span>                 :             :     ConfiguratorInputTypes.UpdateDebtTokenInput calldata input</span>
<span id="L120"><span class="lineNum">     120</span>                 :             :   ) external override onlyPoolAdmin {</span>
<span id="L121"><span class="lineNum">     121</span>                 :<span class="tlaGNC">           2 :     ConfiguratorLogic.executeUpdateStableDebtToken(_pool, input);</span></span>
<span id="L122"><span class="lineNum">     122</span>                 :             :   }</span>
<span id="L123"><span class="lineNum">     123</span>                 :             : </span>
<span id="L124"><span class="lineNum">     124</span>                 :             :   /// @inheritdoc IPoolConfigurator</span>
<span id="L125"><span class="lineNum">     125</span>                 :<span class="tlaGNC">           2 :   function updateVariableDebtToken(</span></span>
<span id="L126"><span class="lineNum">     126</span>                 :             :     ConfiguratorInputTypes.UpdateDebtTokenInput calldata input</span>
<span id="L127"><span class="lineNum">     127</span>                 :             :   ) external override onlyPoolAdmin {</span>
<span id="L128"><span class="lineNum">     128</span>                 :<span class="tlaGNC">           2 :     ConfiguratorLogic.executeUpdateVariableDebtToken(_pool, input);</span></span>
<span id="L129"><span class="lineNum">     129</span>                 :             :   }</span>
<span id="L130"><span class="lineNum">     130</span>                 :             : </span>
<span id="L131"><span class="lineNum">     131</span>                 :             :   /// @inheritdoc IPoolConfigurator</span>
<span id="L132"><span class="lineNum">     132</span>                 :<span class="tlaGNC">        1751 :   function setReserveBorrowing(address asset, bool enabled) external override onlyRiskOrPoolAdmins {</span></span>
<span id="L133"><span class="lineNum">     133</span>                 :<span class="tlaGNC">        5250 :     DataTypes.ReserveConfigurationMap memory currentConfig = _pool.getConfiguration(asset);</span></span>
<span id="L134"><span class="lineNum">     134</span>                 :<span class="tlaGNC">        3500 :     if (!enabled) {</span></span>
<span id="L135"><span class="lineNum">     135</span>                 :<span class="tlaGNC">           4 :       require(!currentConfig.getStableRateBorrowingEnabled(), Errors.STABLE_BORROWING_ENABLED);</span></span>
<span id="L136"><span class="lineNum">     136</span>                 :             :     }</span>
<span id="L137"><span class="lineNum">     137</span>                 :<span class="tlaGNC">        3500 :     currentConfig.setBorrowingEnabled(enabled);</span></span>
<span id="L138"><span class="lineNum">     138</span>                 :<span class="tlaGNC">        3500 :     _pool.setConfiguration(asset, currentConfig);</span></span>
<span id="L139"><span class="lineNum">     139</span>                 :<span class="tlaGNC">        3500 :     emit ReserveBorrowing(asset, enabled);</span></span>
<span id="L140"><span class="lineNum">     140</span>                 :             :   }</span>
<span id="L141"><span class="lineNum">     141</span>                 :             : </span>
<span id="L142"><span class="lineNum">     142</span>                 :             :   /// @inheritdoc IPoolConfigurator</span>
<span id="L143"><span class="lineNum">     143</span>                 :<span class="tlaGNC">        4757 :   function configureReserveAsCollateral(</span></span>
<span id="L144"><span class="lineNum">     144</span>                 :             :     address asset,</span>
<span id="L145"><span class="lineNum">     145</span>                 :             :     uint256 ltv,</span>
<span id="L146"><span class="lineNum">     146</span>                 :             :     uint256 liquidationThreshold,</span>
<span id="L147"><span class="lineNum">     147</span>                 :             :     uint256 liquidationBonus</span>
<span id="L148"><span class="lineNum">     148</span>                 :             :   ) external override onlyRiskOrPoolAdmins {</span>
<span id="L149"><span class="lineNum">     149</span>                 :             :     //validation of the parameters: the LTV can</span>
<span id="L150"><span class="lineNum">     150</span>                 :             :     //only be lower or equal than the liquidation threshold</span>
<span id="L151"><span class="lineNum">     151</span>                 :             :     //(otherwise a loan against the asset would cause instantaneous liquidation)</span>
<span id="L152"><span class="lineNum">     152</span>                 :<span class="tlaGNC">        9512 :     require(ltv &lt;= liquidationThreshold, Errors.INVALID_RESERVE_PARAMS);</span></span>
<span id="L153"><span class="lineNum">     153</span>                 :             : </span>
<span id="L154"><span class="lineNum">     154</span>                 :<span class="tlaGNC">       14262 :     DataTypes.ReserveConfigurationMap memory currentConfig = _pool.getConfiguration(asset);</span></span>
<span id="L155"><span class="lineNum">     155</span>                 :             : </span>
<span id="L156"><span class="lineNum">     156</span>                 :<span class="tlaGNC">        9508 :     if (liquidationThreshold != 0) {</span></span>
<span id="L157"><span class="lineNum">     157</span>                 :             :       //liquidation bonus must be bigger than 100.00%, otherwise the liquidator would receive less</span>
<span id="L158"><span class="lineNum">     158</span>                 :             :       //collateral than needed to cover the debt</span>
<span id="L159"><span class="lineNum">     159</span>                 :<span class="tlaGNC">        9504 :       require(liquidationBonus &gt; PercentageMath.PERCENTAGE_FACTOR, Errors.INVALID_RESERVE_PARAMS);</span></span>
<span id="L160"><span class="lineNum">     160</span>                 :             : </span>
<span id="L161"><span class="lineNum">     161</span>                 :             :       //if threshold * bonus is less than PERCENTAGE_FACTOR, it's guaranteed that at the moment</span>
<span id="L162"><span class="lineNum">     162</span>                 :             :       //a loan is taken there is enough collateral available to cover the liquidation bonus</span>
<span id="L163"><span class="lineNum">     163</span>                 :<span class="tlaGNC">        9502 :       require(</span></span>
<span id="L164"><span class="lineNum">     164</span>                 :             :         liquidationThreshold.percentMul(liquidationBonus) &lt;= PercentageMath.PERCENTAGE_FACTOR,</span>
<span id="L165"><span class="lineNum">     165</span>                 :             :         Errors.INVALID_RESERVE_PARAMS</span>
<span id="L166"><span class="lineNum">     166</span>                 :             :       );</span>
<span id="L167"><span class="lineNum">     167</span>                 :             :     } else {</span>
<span id="L168"><span class="lineNum">     168</span>                 :<span class="tlaGNC">           4 :       require(liquidationBonus == 0, Errors.INVALID_RESERVE_PARAMS);</span></span>
<span id="L169"><span class="lineNum">     169</span>                 :             :       //if the liquidation threshold is being set to 0,</span>
<span id="L170"><span class="lineNum">     170</span>                 :             :       // the reserve is being disabled as collateral. To do so,</span>
<span id="L171"><span class="lineNum">     171</span>                 :             :       //we need to ensure no liquidity is supplied</span>
<span id="L172"><span class="lineNum">     172</span>                 :<span class="tlaGNC">           4 :       _checkNoSuppliers(asset);</span></span>
<span id="L173"><span class="lineNum">     173</span>                 :             :     }</span>
<span id="L174"><span class="lineNum">     174</span>                 :             : </span>
<span id="L175"><span class="lineNum">     175</span>                 :<span class="tlaGNC">        9502 :     if (currentConfig.getFrozen()) {</span></span>
<span id="L176"><span class="lineNum">     176</span>                 :<span class="tlaGNC">        2000 :       _pendingLtv[asset] = ltv;</span></span>
<span id="L177"><span class="lineNum">     177</span>                 :<span class="tlaGNC">        2000 :       _isPendingLtvSet[asset] = true;</span></span>
<span id="L178"><span class="lineNum">     178</span>                 :             : </span>
<span id="L179"><span class="lineNum">     179</span>                 :<span class="tlaGNC">        2000 :       emit PendingLtvChanged(asset, ltv);</span></span>
<span id="L180"><span class="lineNum">     180</span>                 :             :     } else {</span>
<span id="L181"><span class="lineNum">     181</span>                 :<span class="tlaGNC">        7502 :       currentConfig.setLtv(ltv);</span></span>
<span id="L182"><span class="lineNum">     182</span>                 :             :     }</span>
<span id="L183"><span class="lineNum">     183</span>                 :             : </span>
<span id="L184"><span class="lineNum">     184</span>                 :<span class="tlaGNC">        9502 :     currentConfig.setLiquidationThreshold(liquidationThreshold);</span></span>
<span id="L185"><span class="lineNum">     185</span>                 :<span class="tlaGNC">        9502 :     currentConfig.setLiquidationBonus(liquidationBonus);</span></span>
<span id="L186"><span class="lineNum">     186</span>                 :             : </span>
<span id="L187"><span class="lineNum">     187</span>                 :<span class="tlaGNC">        9502 :     _pool.setConfiguration(asset, currentConfig);</span></span>
<span id="L188"><span class="lineNum">     188</span>                 :             : </span>
<span id="L189"><span class="lineNum">     189</span>                 :<span class="tlaGNC">        9502 :     emit CollateralConfigurationChanged(asset, ltv, liquidationThreshold, liquidationBonus);</span></span>
<span id="L190"><span class="lineNum">     190</span>                 :             :   }</span>
<span id="L191"><span class="lineNum">     191</span>                 :             : </span>
<span id="L192"><span class="lineNum">     192</span>                 :             :   /// @inheritdoc IPoolConfigurator</span>
<span id="L193"><span class="lineNum">     193</span>                 :<span class="tlaGNC">        1933 :   function setReserveStableRateBorrowing(</span></span>
<span id="L194"><span class="lineNum">     194</span>                 :             :     address asset,</span>
<span id="L195"><span class="lineNum">     195</span>                 :             :     bool enabled</span>
<span id="L196"><span class="lineNum">     196</span>                 :             :   ) external override onlyRiskOrPoolAdmins {</span>
<span id="L197"><span class="lineNum">     197</span>                 :<span class="tlaGNC">        5796 :     DataTypes.ReserveConfigurationMap memory currentConfig = _pool.getConfiguration(asset);</span></span>
<span id="L198"><span class="lineNum">     198</span>                 :<span class="tlaGNC">        1932 :     if (enabled) {</span></span>
<span id="L199"><span class="lineNum">     199</span>                 :<span class="tlaGNC">         368 :       require(currentConfig.getBorrowingEnabled(), Errors.BORROWING_NOT_ENABLED);</span></span>
<span id="L200"><span class="lineNum">     200</span>                 :             :     }</span>
<span id="L201"><span class="lineNum">     201</span>                 :<span class="tlaGNC">        3862 :     currentConfig.setStableRateBorrowingEnabled(enabled);</span></span>
<span id="L202"><span class="lineNum">     202</span>                 :<span class="tlaGNC">        3862 :     _pool.setConfiguration(asset, currentConfig);</span></span>
<span id="L203"><span class="lineNum">     203</span>                 :<span class="tlaGNC">        3862 :     emit ReserveStableRateBorrowing(asset, enabled);</span></span>
<span id="L204"><span class="lineNum">     204</span>                 :             :   }</span>
<span id="L205"><span class="lineNum">     205</span>                 :             : </span>
<span id="L206"><span class="lineNum">     206</span>                 :             :   /// @inheritdoc IPoolConfigurator</span>
<span id="L207"><span class="lineNum">     207</span>                 :<span class="tlaGNC">        1749 :   function setReserveFlashLoaning(</span></span>
<span id="L208"><span class="lineNum">     208</span>                 :             :     address asset,</span>
<span id="L209"><span class="lineNum">     209</span>                 :             :     bool enabled</span>
<span id="L210"><span class="lineNum">     210</span>                 :             :   ) external override onlyRiskOrPoolAdmins {</span>
<span id="L211"><span class="lineNum">     211</span>                 :<span class="tlaGNC">        5247 :     DataTypes.ReserveConfigurationMap memory currentConfig = _pool.getConfiguration(asset);</span></span>
<span id="L212"><span class="lineNum">     212</span>                 :             : </span>
<span id="L213"><span class="lineNum">     213</span>                 :<span class="tlaGNC">        3498 :     currentConfig.setFlashLoanEnabled(enabled);</span></span>
<span id="L214"><span class="lineNum">     214</span>                 :<span class="tlaGNC">        3498 :     _pool.setConfiguration(asset, currentConfig);</span></span>
<span id="L215"><span class="lineNum">     215</span>                 :<span class="tlaGNC">        3498 :     emit ReserveFlashLoaning(asset, enabled);</span></span>
<span id="L216"><span class="lineNum">     216</span>                 :             :   }</span>
<span id="L217"><span class="lineNum">     217</span>                 :             : </span>
<span id="L218"><span class="lineNum">     218</span>                 :             :   /// @inheritdoc IPoolConfigurator</span>
<span id="L219"><span class="lineNum">     219</span>                 :<span class="tlaGNC">          14 :   function setReserveActive(address asset, bool active) external override onlyPoolAdmin {</span></span>
<span id="L220"><span class="lineNum">     220</span>                 :<span class="tlaGNC">          38 :     if (!active) _checkNoSuppliers(asset);</span></span>
<span id="L221"><span class="lineNum">     221</span>                 :<span class="tlaGNC">          36 :     DataTypes.ReserveConfigurationMap memory currentConfig = _pool.getConfiguration(asset);</span></span>
<span id="L222"><span class="lineNum">     222</span>                 :<span class="tlaGNC">          24 :     currentConfig.setActive(active);</span></span>
<span id="L223"><span class="lineNum">     223</span>                 :<span class="tlaGNC">          24 :     _pool.setConfiguration(asset, currentConfig);</span></span>
<span id="L224"><span class="lineNum">     224</span>                 :<span class="tlaGNC">          24 :     emit ReserveActive(asset, active);</span></span>
<span id="L225"><span class="lineNum">     225</span>                 :             :   }</span>
<span id="L226"><span class="lineNum">     226</span>                 :             : </span>
<span id="L227"><span class="lineNum">     227</span>                 :             :   /// @inheritdoc IPoolConfigurator</span>
<span id="L228"><span class="lineNum">     228</span>                 :<span class="tlaGNC">        1011 :   function setReserveFreeze(</span></span>
<span id="L229"><span class="lineNum">     229</span>                 :             :     address asset,</span>
<span id="L230"><span class="lineNum">     230</span>                 :             :     bool freeze</span>
<span id="L231"><span class="lineNum">     231</span>                 :             :   ) external override onlyRiskOrPoolOrEmergencyAdmins {</span>
<span id="L232"><span class="lineNum">     232</span>                 :<span class="tlaGNC">        3030 :     DataTypes.ReserveConfigurationMap memory currentConfig = _pool.getConfiguration(asset);</span></span>
<span id="L233"><span class="lineNum">     233</span>                 :<span class="tlaGNC">        2020 :     currentConfig.setFrozen(freeze);</span></span>
<span id="L234"><span class="lineNum">     234</span>                 :             : </span>
<span id="L235"><span class="lineNum">     235</span>                 :<span class="tlaGNC">        1010 :     if (freeze) {</span></span>
<span id="L236"><span class="lineNum">     236</span>                 :<span class="tlaGNC">        2016 :       _pendingLtv[asset] = currentConfig.getLtv();</span></span>
<span id="L237"><span class="lineNum">     237</span>                 :<span class="tlaGNC">        2016 :       _isPendingLtvSet[asset] = true;</span></span>
<span id="L238"><span class="lineNum">     238</span>                 :<span class="tlaGNC">        2016 :       currentConfig.setLtv(0);</span></span>
<span id="L239"><span class="lineNum">     239</span>                 :             : </span>
<span id="L240"><span class="lineNum">     240</span>                 :<span class="tlaGNC">        2016 :       emit PendingLtvChanged(asset, currentConfig.getLtv());</span></span>
<span id="L241"><span class="lineNum">     241</span>                 :<span class="tlaGNC">           2 :     } else if (_isPendingLtvSet[asset]) {</span></span>
<span id="L242"><span class="lineNum">     242</span>                 :<span class="tlaGNC">           2 :       uint256 ltv = _pendingLtv[asset];</span></span>
<span id="L243"><span class="lineNum">     243</span>                 :<span class="tlaGNC">           2 :       currentConfig.setLtv(ltv);</span></span>
<span id="L244"><span class="lineNum">     244</span>                 :             : </span>
<span id="L245"><span class="lineNum">     245</span>                 :<span class="tlaGNC">           2 :       delete _pendingLtv[asset];</span></span>
<span id="L246"><span class="lineNum">     246</span>                 :<span class="tlaGNC">           2 :       delete _isPendingLtvSet[asset];</span></span>
<span id="L247"><span class="lineNum">     247</span>                 :             : </span>
<span id="L248"><span class="lineNum">     248</span>                 :<span class="tlaGNC">           2 :       emit PendingLtvRemoved(asset);</span></span>
<span id="L249"><span class="lineNum">     249</span>                 :             :     }</span>
<span id="L250"><span class="lineNum">     250</span>                 :             : </span>
<span id="L251"><span class="lineNum">     251</span>                 :<span class="tlaGNC">        2020 :     _pool.setConfiguration(asset, currentConfig);</span></span>
<span id="L252"><span class="lineNum">     252</span>                 :<span class="tlaGNC">        2020 :     emit ReserveFrozen(asset, freeze);</span></span>
<span id="L253"><span class="lineNum">     253</span>                 :             :   }</span>
<span id="L254"><span class="lineNum">     254</span>                 :             : </span>
<span id="L255"><span class="lineNum">     255</span>                 :             :   /// @inheritdoc IPoolConfigurator</span>
<span id="L256"><span class="lineNum">     256</span>                 :<span class="tlaGNC">        1759 :   function setBorrowableInIsolation(</span></span>
<span id="L257"><span class="lineNum">     257</span>                 :             :     address asset,</span>
<span id="L258"><span class="lineNum">     258</span>                 :             :     bool borrowable</span>
<span id="L259"><span class="lineNum">     259</span>                 :             :   ) external override onlyRiskOrPoolAdmins {</span>
<span id="L260"><span class="lineNum">     260</span>                 :<span class="tlaGNC">        5277 :     DataTypes.ReserveConfigurationMap memory currentConfig = _pool.getConfiguration(asset);</span></span>
<span id="L261"><span class="lineNum">     261</span>                 :<span class="tlaGNC">        3518 :     currentConfig.setBorrowableInIsolation(borrowable);</span></span>
<span id="L262"><span class="lineNum">     262</span>                 :<span class="tlaGNC">        3518 :     _pool.setConfiguration(asset, currentConfig);</span></span>
<span id="L263"><span class="lineNum">     263</span>                 :<span class="tlaGNC">        3518 :     emit BorrowableInIsolationChanged(asset, borrowable);</span></span>
<span id="L264"><span class="lineNum">     264</span>                 :             :   }</span>
<span id="L265"><span class="lineNum">     265</span>                 :             : </span>
<span id="L266"><span class="lineNum">     266</span>                 :             :   /// @inheritdoc IPoolConfigurator</span>
<span id="L267"><span class="lineNum">     267</span>                 :<span class="tlaGNC">        8891 :   function setReservePause(</span></span>
<span id="L268"><span class="lineNum">     268</span>                 :             :     address asset,</span>
<span id="L269"><span class="lineNum">     269</span>                 :             :     bool paused,</span>
<span id="L270"><span class="lineNum">     270</span>                 :             :     uint40 gracePeriod</span>
<span id="L271"><span class="lineNum">     271</span>                 :             :   ) public override onlyEmergencyOrPoolAdmin {</span>
<span id="L272"><span class="lineNum">     272</span>                 :             :     // Only setting grace period if the transition is paused -&gt; unpaused</span>
<span id="L273"><span class="lineNum">     273</span>                 :<span class="tlaGNC">       35582 :     if (!paused &amp;&amp; gracePeriod != 0) {</span></span>
<span id="L274"><span class="lineNum">     274</span>                 :<span class="tlaGNC">       16056 :       require(gracePeriod &lt;= MAX_GRACE_PERIOD, Errors.INVALID_GRACE_PERIOD);</span></span>
<span id="L275"><span class="lineNum">     275</span>                 :             : </span>
<span id="L276"><span class="lineNum">     276</span>                 :<span class="tlaGNC">       28112 :       uint40 until = uint40(block.timestamp) + gracePeriod;</span></span>
<span id="L277"><span class="lineNum">     277</span>                 :<span class="tlaGNC">       14056 :       _pool.setLiquidationGracePeriod(asset, until);</span></span>
<span id="L278"><span class="lineNum">     278</span>                 :<span class="tlaGNC">       14056 :       emit LiquidationGracePeriodChanged(asset, until);</span></span>
<span id="L279"><span class="lineNum">     279</span>                 :             :     }</span>
<span id="L280"><span class="lineNum">     280</span>                 :             : </span>
<span id="L281"><span class="lineNum">     281</span>                 :<span class="tlaGNC">       23700 :     DataTypes.ReserveConfigurationMap memory currentConfig = _pool.getConfiguration(asset);</span></span>
<span id="L282"><span class="lineNum">     282</span>                 :<span class="tlaGNC">       15800 :     currentConfig.setPaused(paused);</span></span>
<span id="L283"><span class="lineNum">     283</span>                 :<span class="tlaGNC">       15800 :     _pool.setConfiguration(asset, currentConfig);</span></span>
<span id="L284"><span class="lineNum">     284</span>                 :<span class="tlaGNC">       15800 :     emit ReservePaused(asset, paused);</span></span>
<span id="L285"><span class="lineNum">     285</span>                 :             :   }</span>
<span id="L286"><span class="lineNum">     286</span>                 :             : </span>
<span id="L287"><span class="lineNum">     287</span>                 :             :   /// @inheritdoc IPoolConfigurator</span>
<span id="L288"><span class="lineNum">     288</span>                 :             :   function setReservePause(address asset, bool paused) public override onlyEmergencyOrPoolAdmin {</span>
<span id="L289"><span class="lineNum">     289</span>                 :<span class="tlaUNC tlaBgUNC">           0 :     setReservePause(asset, paused, 0);</span></span>
<span id="L290"><span class="lineNum">     290</span>                 :             :   }</span>
<span id="L291"><span class="lineNum">     291</span>                 :             : </span>
<span id="L292"><span class="lineNum">     292</span>                 :             :   /// @inheritdoc IPoolConfigurator</span>
<span id="L293"><span class="lineNum">     293</span>                 :<span class="tlaGNC tlaBgGNC">        1749 :   function setReserveFactor(</span></span>
<span id="L294"><span class="lineNum">     294</span>                 :             :     address asset,</span>
<span id="L295"><span class="lineNum">     295</span>                 :             :     uint256 newReserveFactor</span>
<span id="L296"><span class="lineNum">     296</span>                 :             :   ) external override onlyRiskOrPoolAdmins {</span>
<span id="L297"><span class="lineNum">     297</span>                 :<span class="tlaGNC">        3496 :     require(newReserveFactor &lt;= PercentageMath.PERCENTAGE_FACTOR, Errors.INVALID_RESERVE_FACTOR);</span></span>
<span id="L298"><span class="lineNum">     298</span>                 :             : </span>
<span id="L299"><span class="lineNum">     299</span>                 :<span class="tlaGNC">        3494 :     _pool.syncIndexesState(asset);</span></span>
<span id="L300"><span class="lineNum">     300</span>                 :             : </span>
<span id="L301"><span class="lineNum">     301</span>                 :<span class="tlaGNC">        5241 :     DataTypes.ReserveConfigurationMap memory currentConfig = _pool.getConfiguration(asset);</span></span>
<span id="L302"><span class="lineNum">     302</span>                 :<span class="tlaGNC">        5241 :     uint256 oldReserveFactor = currentConfig.getReserveFactor();</span></span>
<span id="L303"><span class="lineNum">     303</span>                 :<span class="tlaGNC">        3494 :     currentConfig.setReserveFactor(newReserveFactor);</span></span>
<span id="L304"><span class="lineNum">     304</span>                 :<span class="tlaGNC">        3494 :     _pool.setConfiguration(asset, currentConfig);</span></span>
<span id="L305"><span class="lineNum">     305</span>                 :<span class="tlaGNC">        3494 :     emit ReserveFactorChanged(asset, oldReserveFactor, newReserveFactor);</span></span>
<span id="L306"><span class="lineNum">     306</span>                 :             : </span>
<span id="L307"><span class="lineNum">     307</span>                 :<span class="tlaGNC">        3494 :     _pool.syncRatesState(asset);</span></span>
<span id="L308"><span class="lineNum">     308</span>                 :             :   }</span>
<span id="L309"><span class="lineNum">     309</span>                 :             : </span>
<span id="L310"><span class="lineNum">     310</span>                 :             :   /// @inheritdoc IPoolConfigurator</span>
<span id="L311"><span class="lineNum">     311</span>                 :<span class="tlaGNC">        1765 :   function setDebtCeiling(</span></span>
<span id="L312"><span class="lineNum">     312</span>                 :             :     address asset,</span>
<span id="L313"><span class="lineNum">     313</span>                 :             :     uint256 newDebtCeiling</span>
<span id="L314"><span class="lineNum">     314</span>                 :             :   ) external override onlyRiskOrPoolAdmins {</span>
<span id="L315"><span class="lineNum">     315</span>                 :<span class="tlaGNC">        5292 :     DataTypes.ReserveConfigurationMap memory currentConfig = _pool.getConfiguration(asset);</span></span>
<span id="L316"><span class="lineNum">     316</span>                 :             : </span>
<span id="L317"><span class="lineNum">     317</span>                 :<span class="tlaGNC">        5292 :     uint256 oldDebtCeiling = currentConfig.getDebtCeiling();</span></span>
<span id="L318"><span class="lineNum">     318</span>                 :<span class="tlaGNC">        8819 :     if (currentConfig.getLiquidationThreshold() != 0 &amp;&amp; oldDebtCeiling == 0) {</span></span>
<span id="L319"><span class="lineNum">     319</span>                 :<span class="tlaGNC">        3520 :       _checkNoSuppliers(asset);</span></span>
<span id="L320"><span class="lineNum">     320</span>                 :             :     }</span>
<span id="L321"><span class="lineNum">     321</span>                 :<span class="tlaGNC">        3526 :     currentConfig.setDebtCeiling(newDebtCeiling);</span></span>
<span id="L322"><span class="lineNum">     322</span>                 :<span class="tlaGNC">        3526 :     _pool.setConfiguration(asset, currentConfig);</span></span>
<span id="L323"><span class="lineNum">     323</span>                 :             : </span>
<span id="L324"><span class="lineNum">     324</span>                 :<span class="tlaGNC">        3526 :     if (newDebtCeiling == 0) {</span></span>
<span id="L325"><span class="lineNum">     325</span>                 :<span class="tlaGNC">        3498 :       _pool.resetIsolationModeTotalDebt(asset);</span></span>
<span id="L326"><span class="lineNum">     326</span>                 :             :     }</span>
<span id="L327"><span class="lineNum">     327</span>                 :             : </span>
<span id="L328"><span class="lineNum">     328</span>                 :<span class="tlaGNC">        3526 :     emit DebtCeilingChanged(asset, oldDebtCeiling, newDebtCeiling);</span></span>
<span id="L329"><span class="lineNum">     329</span>                 :             :   }</span>
<span id="L330"><span class="lineNum">     330</span>                 :             : </span>
<span id="L331"><span class="lineNum">     331</span>                 :             :   /// @inheritdoc IPoolConfigurator</span>
<span id="L332"><span class="lineNum">     332</span>                 :<span class="tlaGNC">        1749 :   function setSiloedBorrowing(</span></span>
<span id="L333"><span class="lineNum">     333</span>                 :             :     address asset,</span>
<span id="L334"><span class="lineNum">     334</span>                 :             :     bool newSiloed</span>
<span id="L335"><span class="lineNum">     335</span>                 :             :   ) external override onlyRiskOrPoolAdmins {</span>
<span id="L336"><span class="lineNum">     336</span>                 :<span class="tlaGNC">        1749 :     if (newSiloed) {</span></span>
<span id="L337"><span class="lineNum">     337</span>                 :<span class="tlaGNC">           6 :       _checkNoBorrowers(asset);</span></span>
<span id="L338"><span class="lineNum">     338</span>                 :             :     }</span>
<span id="L339"><span class="lineNum">     339</span>                 :<span class="tlaGNC">        5244 :     DataTypes.ReserveConfigurationMap memory currentConfig = _pool.getConfiguration(asset);</span></span>
<span id="L340"><span class="lineNum">     340</span>                 :             : </span>
<span id="L341"><span class="lineNum">     341</span>                 :<span class="tlaGNC">        5244 :     bool oldSiloed = currentConfig.getSiloedBorrowing();</span></span>
<span id="L342"><span class="lineNum">     342</span>                 :             : </span>
<span id="L343"><span class="lineNum">     343</span>                 :<span class="tlaGNC">        3496 :     currentConfig.setSiloedBorrowing(newSiloed);</span></span>
<span id="L344"><span class="lineNum">     344</span>                 :             : </span>
<span id="L345"><span class="lineNum">     345</span>                 :<span class="tlaGNC">        3496 :     _pool.setConfiguration(asset, currentConfig);</span></span>
<span id="L346"><span class="lineNum">     346</span>                 :             : </span>
<span id="L347"><span class="lineNum">     347</span>                 :<span class="tlaGNC">        3496 :     emit SiloedBorrowingChanged(asset, oldSiloed, newSiloed);</span></span>
<span id="L348"><span class="lineNum">     348</span>                 :             :   }</span>
<span id="L349"><span class="lineNum">     349</span>                 :             : </span>
<span id="L350"><span class="lineNum">     350</span>                 :             :   /// @inheritdoc IPoolConfigurator</span>
<span id="L351"><span class="lineNum">     351</span>                 :<span class="tlaGNC">        1759 :   function setBorrowCap(</span></span>
<span id="L352"><span class="lineNum">     352</span>                 :             :     address asset,</span>
<span id="L353"><span class="lineNum">     353</span>                 :             :     uint256 newBorrowCap</span>
<span id="L354"><span class="lineNum">     354</span>                 :             :   ) external override onlyRiskOrPoolAdmins {</span>
<span id="L355"><span class="lineNum">     355</span>                 :<span class="tlaGNC">        5271 :     DataTypes.ReserveConfigurationMap memory currentConfig = _pool.getConfiguration(asset);</span></span>
<span id="L356"><span class="lineNum">     356</span>                 :<span class="tlaGNC">        5271 :     uint256 oldBorrowCap = currentConfig.getBorrowCap();</span></span>
<span id="L357"><span class="lineNum">     357</span>                 :<span class="tlaGNC">        3514 :     currentConfig.setBorrowCap(newBorrowCap);</span></span>
<span id="L358"><span class="lineNum">     358</span>                 :<span class="tlaGNC">        3512 :     _pool.setConfiguration(asset, currentConfig);</span></span>
<span id="L359"><span class="lineNum">     359</span>                 :<span class="tlaGNC">        3512 :     emit BorrowCapChanged(asset, oldBorrowCap, newBorrowCap);</span></span>
<span id="L360"><span class="lineNum">     360</span>                 :             :   }</span>
<span id="L361"><span class="lineNum">     361</span>                 :             : </span>
<span id="L362"><span class="lineNum">     362</span>                 :             :   /// @inheritdoc IPoolConfigurator</span>
<span id="L363"><span class="lineNum">     363</span>                 :<span class="tlaGNC">        1762 :   function setSupplyCap(</span></span>
<span id="L364"><span class="lineNum">     364</span>                 :             :     address asset,</span>
<span id="L365"><span class="lineNum">     365</span>                 :             :     uint256 newSupplyCap</span>
<span id="L366"><span class="lineNum">     366</span>                 :             :   ) external override onlyRiskOrPoolAdmins {</span>
<span id="L367"><span class="lineNum">     367</span>                 :<span class="tlaGNC">        5280 :     DataTypes.ReserveConfigurationMap memory currentConfig = _pool.getConfiguration(asset);</span></span>
<span id="L368"><span class="lineNum">     368</span>                 :<span class="tlaGNC">        5280 :     uint256 oldSupplyCap = currentConfig.getSupplyCap();</span></span>
<span id="L369"><span class="lineNum">     369</span>                 :<span class="tlaGNC">        3520 :     currentConfig.setSupplyCap(newSupplyCap);</span></span>
<span id="L370"><span class="lineNum">     370</span>                 :<span class="tlaGNC">        3518 :     _pool.setConfiguration(asset, currentConfig);</span></span>
<span id="L371"><span class="lineNum">     371</span>                 :<span class="tlaGNC">        3518 :     emit SupplyCapChanged(asset, oldSupplyCap, newSupplyCap);</span></span>
<span id="L372"><span class="lineNum">     372</span>                 :             :   }</span>
<span id="L373"><span class="lineNum">     373</span>                 :             : </span>
<span id="L374"><span class="lineNum">     374</span>                 :             :   /// @inheritdoc IPoolConfigurator</span>
<span id="L375"><span class="lineNum">     375</span>                 :<span class="tlaGNC">        1754 :   function setLiquidationProtocolFee(</span></span>
<span id="L376"><span class="lineNum">     376</span>                 :             :     address asset,</span>
<span id="L377"><span class="lineNum">     377</span>                 :             :     uint256 newFee</span>
<span id="L378"><span class="lineNum">     378</span>                 :             :   ) external override onlyRiskOrPoolAdmins {</span>
<span id="L379"><span class="lineNum">     379</span>                 :<span class="tlaGNC">        3506 :     require(newFee &lt;= PercentageMath.PERCENTAGE_FACTOR, Errors.INVALID_LIQUIDATION_PROTOCOL_FEE);</span></span>
<span id="L380"><span class="lineNum">     380</span>                 :<span class="tlaGNC">        5253 :     DataTypes.ReserveConfigurationMap memory currentConfig = _pool.getConfiguration(asset);</span></span>
<span id="L381"><span class="lineNum">     381</span>                 :<span class="tlaGNC">        5253 :     uint256 oldFee = currentConfig.getLiquidationProtocolFee();</span></span>
<span id="L382"><span class="lineNum">     382</span>                 :<span class="tlaGNC">        3502 :     currentConfig.setLiquidationProtocolFee(newFee);</span></span>
<span id="L383"><span class="lineNum">     383</span>                 :<span class="tlaGNC">        3502 :     _pool.setConfiguration(asset, currentConfig);</span></span>
<span id="L384"><span class="lineNum">     384</span>                 :<span class="tlaGNC">        3502 :     emit LiquidationProtocolFeeChanged(asset, oldFee, newFee);</span></span>
<span id="L385"><span class="lineNum">     385</span>                 :             :   }</span>
<span id="L386"><span class="lineNum">     386</span>                 :             : </span>
<span id="L387"><span class="lineNum">     387</span>                 :             :   /// @inheritdoc IPoolConfigurator</span>
<span id="L388"><span class="lineNum">     388</span>                 :<span class="tlaGNC">          38 :   function setEModeCategory(</span></span>
<span id="L389"><span class="lineNum">     389</span>                 :             :     uint8 categoryId,</span>
<span id="L390"><span class="lineNum">     390</span>                 :             :     uint16 ltv,</span>
<span id="L391"><span class="lineNum">     391</span>                 :             :     uint16 liquidationThreshold,</span>
<span id="L392"><span class="lineNum">     392</span>                 :             :     uint16 liquidationBonus,</span>
<span id="L393"><span class="lineNum">     393</span>                 :             :     address oracle,</span>
<span id="L394"><span class="lineNum">     394</span>                 :             :     string calldata label</span>
<span id="L395"><span class="lineNum">     395</span>                 :             :   ) external override onlyRiskOrPoolAdmins {</span>
<span id="L396"><span class="lineNum">     396</span>                 :<span class="tlaGNC">          74 :     require(ltv != 0, Errors.INVALID_EMODE_CATEGORY_PARAMS);</span></span>
<span id="L397"><span class="lineNum">     397</span>                 :<span class="tlaGNC">          72 :     require(liquidationThreshold != 0, Errors.INVALID_EMODE_CATEGORY_PARAMS);</span></span>
<span id="L398"><span class="lineNum">     398</span>                 :             : </span>
<span id="L399"><span class="lineNum">     399</span>                 :             :     // validation of the parameters: the LTV can</span>
<span id="L400"><span class="lineNum">     400</span>                 :             :     // only be lower or equal than the liquidation threshold</span>
<span id="L401"><span class="lineNum">     401</span>                 :             :     // (otherwise a loan against the asset would cause instantaneous liquidation)</span>
<span id="L402"><span class="lineNum">     402</span>                 :<span class="tlaGNC">          70 :     require(ltv &lt;= liquidationThreshold, Errors.INVALID_EMODE_CATEGORY_PARAMS);</span></span>
<span id="L403"><span class="lineNum">     403</span>                 :<span class="tlaGNC">          66 :     require(</span></span>
<span id="L404"><span class="lineNum">     404</span>                 :             :       liquidationBonus &gt; PercentageMath.PERCENTAGE_FACTOR,</span>
<span id="L405"><span class="lineNum">     405</span>                 :             :       Errors.INVALID_EMODE_CATEGORY_PARAMS</span>
<span id="L406"><span class="lineNum">     406</span>                 :             :     );</span>
<span id="L407"><span class="lineNum">     407</span>                 :             : </span>
<span id="L408"><span class="lineNum">     408</span>                 :             :     // if threshold * bonus is less than PERCENTAGE_FACTOR, it's guaranteed that at the moment</span>
<span id="L409"><span class="lineNum">     409</span>                 :             :     // a loan is taken there is enough collateral available to cover the liquidation bonus</span>
<span id="L410"><span class="lineNum">     410</span>                 :<span class="tlaGNC">          62 :     require(</span></span>
<span id="L411"><span class="lineNum">     411</span>                 :             :       uint256(liquidationThreshold).percentMul(liquidationBonus) &lt;=</span>
<span id="L412"><span class="lineNum">     412</span>                 :             :         PercentageMath.PERCENTAGE_FACTOR,</span>
<span id="L413"><span class="lineNum">     413</span>                 :             :       Errors.INVALID_EMODE_CATEGORY_PARAMS</span>
<span id="L414"><span class="lineNum">     414</span>                 :             :     );</span>
<span id="L415"><span class="lineNum">     415</span>                 :             : </span>
<span id="L416"><span class="lineNum">     416</span>                 :<span class="tlaGNC">          90 :     address[] memory reserves = _pool.getReservesList();</span></span>
<span id="L417"><span class="lineNum">     417</span>                 :<span class="tlaGNC">         256 :     for (uint256 i = 0; i &lt; reserves.length; i++) {</span></span>
<span id="L418"><span class="lineNum">     418</span>                 :<span class="tlaGNC">         258 :       DataTypes.ReserveConfigurationMap memory currentConfig = _pool.getConfiguration(reserves[i]);</span></span>
<span id="L419"><span class="lineNum">     419</span>                 :<span class="tlaGNC">         258 :       if (categoryId == currentConfig.getEModeCategory()) {</span></span>
<span id="L420"><span class="lineNum">     420</span>                 :<span class="tlaGNC">           6 :         require(ltv &gt; currentConfig.getLtv(), Errors.INVALID_EMODE_CATEGORY_PARAMS);</span></span>
<span id="L421"><span class="lineNum">     421</span>                 :<span class="tlaGNC">           2 :         require(</span></span>
<span id="L422"><span class="lineNum">     422</span>                 :             :           liquidationThreshold &gt; currentConfig.getLiquidationThreshold(),</span>
<span id="L423"><span class="lineNum">     423</span>                 :             :           Errors.INVALID_EMODE_CATEGORY_PARAMS</span>
<span id="L424"><span class="lineNum">     424</span>                 :             :         );</span>
<span id="L425"><span class="lineNum">     425</span>                 :             :       }</span>
<span id="L426"><span class="lineNum">     426</span>                 :             :     }</span>
<span id="L427"><span class="lineNum">     427</span>                 :             : </span>
<span id="L428"><span class="lineNum">     428</span>                 :<span class="tlaGNC">          54 :     _pool.configureEModeCategory(</span></span>
<span id="L429"><span class="lineNum">     429</span>                 :             :       categoryId,</span>
<span id="L430"><span class="lineNum">     430</span>                 :             :       DataTypes.EModeCategory({</span>
<span id="L431"><span class="lineNum">     431</span>                 :             :         ltv: ltv,</span>
<span id="L432"><span class="lineNum">     432</span>                 :             :         liquidationThreshold: liquidationThreshold,</span>
<span id="L433"><span class="lineNum">     433</span>                 :             :         liquidationBonus: liquidationBonus,</span>
<span id="L434"><span class="lineNum">     434</span>                 :             :         priceSource: oracle,</span>
<span id="L435"><span class="lineNum">     435</span>                 :             :         label: label</span>
<span id="L436"><span class="lineNum">     436</span>                 :             :       })</span>
<span id="L437"><span class="lineNum">     437</span>                 :             :     );</span>
<span id="L438"><span class="lineNum">     438</span>                 :<span class="tlaGNC">          54 :     emit EModeCategoryAdded(categoryId, ltv, liquidationThreshold, liquidationBonus, oracle, label);</span></span>
<span id="L439"><span class="lineNum">     439</span>                 :             :   }</span>
<span id="L440"><span class="lineNum">     440</span>                 :             : </span>
<span id="L441"><span class="lineNum">     441</span>                 :             :   /// @inheritdoc IPoolConfigurator</span>
<span id="L442"><span class="lineNum">     442</span>                 :<span class="tlaGNC">        1786 :   function setAssetEModeCategory(</span></span>
<span id="L443"><span class="lineNum">     443</span>                 :             :     address asset,</span>
<span id="L444"><span class="lineNum">     444</span>                 :             :     uint8 newCategoryId</span>
<span id="L445"><span class="lineNum">     445</span>                 :             :   ) external override onlyRiskOrPoolAdmins {</span>
<span id="L446"><span class="lineNum">     446</span>                 :<span class="tlaGNC">        5355 :     DataTypes.ReserveConfigurationMap memory currentConfig = _pool.getConfiguration(asset);</span></span>
<span id="L447"><span class="lineNum">     447</span>                 :             : </span>
<span id="L448"><span class="lineNum">     448</span>                 :<span class="tlaGNC">        3570 :     if (newCategoryId != 0) {</span></span>
<span id="L449"><span class="lineNum">     449</span>                 :<span class="tlaGNC">         114 :       DataTypes.EModeCategory memory categoryData = _pool.getEModeCategoryData(newCategoryId);</span></span>
<span id="L450"><span class="lineNum">     450</span>                 :<span class="tlaGNC">          76 :       require(</span></span>
<span id="L451"><span class="lineNum">     451</span>                 :             :         categoryData.liquidationThreshold &gt; currentConfig.getLiquidationThreshold(),</span>
<span id="L452"><span class="lineNum">     452</span>                 :             :         Errors.INVALID_EMODE_CATEGORY_ASSIGNMENT</span>
<span id="L453"><span class="lineNum">     453</span>                 :             :       );</span>
<span id="L454"><span class="lineNum">     454</span>                 :             :     }</span>
<span id="L455"><span class="lineNum">     455</span>                 :<span class="tlaGNC">        5352 :     uint256 oldCategoryId = currentConfig.getEModeCategory();</span></span>
<span id="L456"><span class="lineNum">     456</span>                 :<span class="tlaGNC">        3568 :     currentConfig.setEModeCategory(newCategoryId);</span></span>
<span id="L457"><span class="lineNum">     457</span>                 :<span class="tlaGNC">        3568 :     _pool.setConfiguration(asset, currentConfig);</span></span>
<span id="L458"><span class="lineNum">     458</span>                 :<span class="tlaGNC">        3568 :     emit EModeAssetCategoryChanged(asset, uint8(oldCategoryId), newCategoryId);</span></span>
<span id="L459"><span class="lineNum">     459</span>                 :             :   }</span>
<span id="L460"><span class="lineNum">     460</span>                 :             : </span>
<span id="L461"><span class="lineNum">     461</span>                 :             :   /// @inheritdoc IPoolConfigurator</span>
<span id="L462"><span class="lineNum">     462</span>                 :<span class="tlaGNC">           7 :   function setUnbackedMintCap(</span></span>
<span id="L463"><span class="lineNum">     463</span>                 :             :     address asset,</span>
<span id="L464"><span class="lineNum">     464</span>                 :             :     uint256 newUnbackedMintCap</span>
<span id="L465"><span class="lineNum">     465</span>                 :             :   ) external override onlyRiskOrPoolAdmins {</span>
<span id="L466"><span class="lineNum">     466</span>                 :<span class="tlaGNC">          21 :     DataTypes.ReserveConfigurationMap memory currentConfig = _pool.getConfiguration(asset);</span></span>
<span id="L467"><span class="lineNum">     467</span>                 :<span class="tlaGNC">          21 :     uint256 oldUnbackedMintCap = currentConfig.getUnbackedMintCap();</span></span>
<span id="L468"><span class="lineNum">     468</span>                 :<span class="tlaGNC">          14 :     currentConfig.setUnbackedMintCap(newUnbackedMintCap);</span></span>
<span id="L469"><span class="lineNum">     469</span>                 :<span class="tlaGNC">          14 :     _pool.setConfiguration(asset, currentConfig);</span></span>
<span id="L470"><span class="lineNum">     470</span>                 :<span class="tlaGNC">          14 :     emit UnbackedMintCapChanged(asset, oldUnbackedMintCap, newUnbackedMintCap);</span></span>
<span id="L471"><span class="lineNum">     471</span>                 :             :   }</span>
<span id="L472"><span class="lineNum">     472</span>                 :             : </span>
<span id="L473"><span class="lineNum">     473</span>                 :             :   /// @inheritdoc IPoolConfigurator</span>
<span id="L474"><span class="lineNum">     474</span>                 :<span class="tlaUNC tlaBgUNC">           0 :   function setReserveInterestRateData(</span></span>
<span id="L475"><span class="lineNum">     475</span>                 :             :     address asset,</span>
<span id="L476"><span class="lineNum">     476</span>                 :             :     bytes calldata rateData</span>
<span id="L477"><span class="lineNum">     477</span>                 :             :   ) external onlyRiskOrPoolAdmins {</span>
<span id="L478"><span class="lineNum">     478</span>                 :<span class="tlaUNC">           0 :     DataTypes.ReserveDataLegacy memory reserve = _pool.getReserveData(asset);</span></span>
<span id="L479"><span class="lineNum">     479</span>                 :<span class="tlaUNC">           0 :     _updateInterestRateStrategy(asset, reserve, reserve.interestRateStrategyAddress, rateData);</span></span>
<span id="L480"><span class="lineNum">     480</span>                 :             :   }</span>
<span id="L481"><span class="lineNum">     481</span>                 :             : </span>
<span id="L482"><span class="lineNum">     482</span>                 :             :   /// @inheritdoc IPoolConfigurator</span>
<span id="L483"><span class="lineNum">     483</span>                 :<span class="tlaGNC tlaBgGNC">           5 :   function setReserveInterestRateStrategyAddress(</span></span>
<span id="L484"><span class="lineNum">     484</span>                 :             :     address asset,</span>
<span id="L485"><span class="lineNum">     485</span>                 :             :     address rateStrategyAddress,</span>
<span id="L486"><span class="lineNum">     486</span>                 :             :     bytes calldata rateData</span>
<span id="L487"><span class="lineNum">     487</span>                 :             :   ) external override onlyRiskOrPoolAdmins {</span>
<span id="L488"><span class="lineNum">     488</span>                 :<span class="tlaGNC">          12 :     DataTypes.ReserveDataLegacy memory reserve = _pool.getReserveData(asset);</span></span>
<span id="L489"><span class="lineNum">     489</span>                 :<span class="tlaGNC">           8 :     _updateInterestRateStrategy(asset, reserve, rateStrategyAddress, rateData);</span></span>
<span id="L490"><span class="lineNum">     490</span>                 :             :   }</span>
<span id="L491"><span class="lineNum">     491</span>                 :             : </span>
<span id="L492"><span class="lineNum">     492</span>                 :             :   /// @inheritdoc IPoolConfigurator</span>
<span id="L493"><span class="lineNum">     493</span>                 :<span class="tlaGNC">        3003 :   function setPoolPause(bool paused, uint40 gracePeriod) public override onlyEmergencyOrPoolAdmin {</span></span>
<span id="L494"><span class="lineNum">     494</span>                 :<span class="tlaGNC">        3009 :     address[] memory reserves = _pool.getReservesList();</span></span>
<span id="L495"><span class="lineNum">     495</span>                 :             : </span>
<span id="L496"><span class="lineNum">     496</span>                 :<span class="tlaGNC">        9027 :     for (uint256 i = 0; i &lt; reserves.length; i++) {</span></span>
<span id="L497"><span class="lineNum">     497</span>                 :<span class="tlaGNC">        9027 :       if (reserves[i] != address(0)) {</span></span>
<span id="L498"><span class="lineNum">     498</span>                 :<span class="tlaGNC">        6018 :         setReservePause(reserves[i], paused, gracePeriod);</span></span>
<span id="L499"><span class="lineNum">     499</span>                 :             :       }</span>
<span id="L500"><span class="lineNum">     500</span>                 :             :     }</span>
<span id="L501"><span class="lineNum">     501</span>                 :             :   }</span>
<span id="L502"><span class="lineNum">     502</span>                 :             : </span>
<span id="L503"><span class="lineNum">     503</span>                 :             :   /// @inheritdoc IPoolConfigurator</span>
<span id="L504"><span class="lineNum">     504</span>                 :             :   function setPoolPause(bool paused) external override onlyEmergencyOrPoolAdmin {</span>
<span id="L505"><span class="lineNum">     505</span>                 :<span class="tlaUNC tlaBgUNC">           0 :     setPoolPause(paused, 0);</span></span>
<span id="L506"><span class="lineNum">     506</span>                 :             :   }</span>
<span id="L507"><span class="lineNum">     507</span>                 :             : </span>
<span id="L508"><span class="lineNum">     508</span>                 :             :   /// @inheritdoc IPoolConfigurator</span>
<span id="L509"><span class="lineNum">     509</span>                 :<span class="tlaGNC tlaBgGNC">          14 :   function updateBridgeProtocolFee(uint256 newBridgeProtocolFee) external override onlyPoolAdmin {</span></span>
<span id="L510"><span class="lineNum">     510</span>                 :<span class="tlaGNC">          28 :     require(</span></span>
<span id="L511"><span class="lineNum">     511</span>                 :             :       newBridgeProtocolFee &lt;= PercentageMath.PERCENTAGE_FACTOR,</span>
<span id="L512"><span class="lineNum">     512</span>                 :             :       Errors.BRIDGE_PROTOCOL_FEE_INVALID</span>
<span id="L513"><span class="lineNum">     513</span>                 :             :     );</span>
<span id="L514"><span class="lineNum">     514</span>                 :<span class="tlaGNC">          39 :     uint256 oldBridgeProtocolFee = _pool.BRIDGE_PROTOCOL_FEE();</span></span>
<span id="L515"><span class="lineNum">     515</span>                 :<span class="tlaGNC">          26 :     _pool.updateBridgeProtocolFee(newBridgeProtocolFee);</span></span>
<span id="L516"><span class="lineNum">     516</span>                 :<span class="tlaGNC">          26 :     emit BridgeProtocolFeeUpdated(oldBridgeProtocolFee, newBridgeProtocolFee);</span></span>
<span id="L517"><span class="lineNum">     517</span>                 :             :   }</span>
<span id="L518"><span class="lineNum">     518</span>                 :             : </span>
<span id="L519"><span class="lineNum">     519</span>                 :             :   /// @inheritdoc IPoolConfigurator</span>
<span id="L520"><span class="lineNum">     520</span>                 :<span class="tlaGNC">         608 :   function updateFlashloanPremiumTotal(</span></span>
<span id="L521"><span class="lineNum">     521</span>                 :             :     uint128 newFlashloanPremiumTotal</span>
<span id="L522"><span class="lineNum">     522</span>                 :             :   ) external override onlyPoolAdmin {</span>
<span id="L523"><span class="lineNum">     523</span>                 :<span class="tlaGNC">        1214 :     require(</span></span>
<span id="L524"><span class="lineNum">     524</span>                 :             :       newFlashloanPremiumTotal &lt;= PercentageMath.PERCENTAGE_FACTOR,</span>
<span id="L525"><span class="lineNum">     525</span>                 :             :       Errors.FLASHLOAN_PREMIUM_INVALID</span>
<span id="L526"><span class="lineNum">     526</span>                 :             :     );</span>
<span id="L527"><span class="lineNum">     527</span>                 :<span class="tlaGNC">        1818 :     uint128 oldFlashloanPremiumTotal = _pool.FLASHLOAN_PREMIUM_TOTAL();</span></span>
<span id="L528"><span class="lineNum">     528</span>                 :<span class="tlaGNC">        1212 :     _pool.updateFlashloanPremiums(newFlashloanPremiumTotal, _pool.FLASHLOAN_PREMIUM_TO_PROTOCOL());</span></span>
<span id="L529"><span class="lineNum">     529</span>                 :<span class="tlaGNC">        1212 :     emit FlashloanPremiumTotalUpdated(oldFlashloanPremiumTotal, newFlashloanPremiumTotal);</span></span>
<span id="L530"><span class="lineNum">     530</span>                 :             :   }</span>
<span id="L531"><span class="lineNum">     531</span>                 :             : </span>
<span id="L532"><span class="lineNum">     532</span>                 :             :   /// @inheritdoc IPoolConfigurator</span>
<span id="L533"><span class="lineNum">     533</span>                 :<span class="tlaGNC">         608 :   function updateFlashloanPremiumToProtocol(</span></span>
<span id="L534"><span class="lineNum">     534</span>                 :             :     uint128 newFlashloanPremiumToProtocol</span>
<span id="L535"><span class="lineNum">     535</span>                 :             :   ) external override onlyPoolAdmin {</span>
<span id="L536"><span class="lineNum">     536</span>                 :<span class="tlaGNC">        1214 :     require(</span></span>
<span id="L537"><span class="lineNum">     537</span>                 :             :       newFlashloanPremiumToProtocol &lt;= PercentageMath.PERCENTAGE_FACTOR,</span>
<span id="L538"><span class="lineNum">     538</span>                 :             :       Errors.FLASHLOAN_PREMIUM_INVALID</span>
<span id="L539"><span class="lineNum">     539</span>                 :             :     );</span>
<span id="L540"><span class="lineNum">     540</span>                 :<span class="tlaGNC">        1818 :     uint128 oldFlashloanPremiumToProtocol = _pool.FLASHLOAN_PREMIUM_TO_PROTOCOL();</span></span>
<span id="L541"><span class="lineNum">     541</span>                 :<span class="tlaGNC">        1212 :     _pool.updateFlashloanPremiums(_pool.FLASHLOAN_PREMIUM_TOTAL(), newFlashloanPremiumToProtocol);</span></span>
<span id="L542"><span class="lineNum">     542</span>                 :<span class="tlaGNC">        1212 :     emit FlashloanPremiumToProtocolUpdated(</span></span>
<span id="L543"><span class="lineNum">     543</span>                 :             :       oldFlashloanPremiumToProtocol,</span>
<span id="L544"><span class="lineNum">     544</span>                 :             :       newFlashloanPremiumToProtocol</span>
<span id="L545"><span class="lineNum">     545</span>                 :             :     );</span>
<span id="L546"><span class="lineNum">     546</span>                 :             :   }</span>
<span id="L547"><span class="lineNum">     547</span>                 :             : </span>
<span id="L548"><span class="lineNum">     548</span>                 :             :   /// @inheritdoc IPoolConfigurator</span>
<span id="L549"><span class="lineNum">     549</span>                 :<span class="tlaGNC">        2003 :   function getPendingLtv(address asset) external view override returns (uint256, bool) {</span></span>
<span id="L550"><span class="lineNum">     550</span>                 :<span class="tlaGNC">        4006 :     return (_pendingLtv[asset], _isPendingLtvSet[asset]);</span></span>
<span id="L551"><span class="lineNum">     551</span>                 :             :   }</span>
<span id="L552"><span class="lineNum">     552</span>                 :             : </span>
<span id="L553"><span class="lineNum">     553</span>                 :             :   /// @inheritdoc IPoolConfigurator</span>
<span id="L554"><span class="lineNum">     554</span>                 :<span class="tlaGNC">           1 :   function getConfiguratorLogic() external pure returns (address) {</span></span>
<span id="L555"><span class="lineNum">     555</span>                 :<span class="tlaGNC">           3 :     return address(ConfiguratorLogic);</span></span>
<span id="L556"><span class="lineNum">     556</span>                 :             :   }</span>
<span id="L557"><span class="lineNum">     557</span>                 :             : </span>
<span id="L558"><span class="lineNum">     558</span>                 :<span class="tlaGNC">           4 :   function _updateInterestRateStrategy(</span></span>
<span id="L559"><span class="lineNum">     559</span>                 :             :     address asset,</span>
<span id="L560"><span class="lineNum">     560</span>                 :             :     DataTypes.ReserveDataLegacy memory reserve,</span>
<span id="L561"><span class="lineNum">     561</span>                 :             :     address newRateStrategyAddress,</span>
<span id="L562"><span class="lineNum">     562</span>                 :             :     bytes calldata rateData</span>
<span id="L563"><span class="lineNum">     563</span>                 :             :   ) internal {</span>
<span id="L564"><span class="lineNum">     564</span>                 :<span class="tlaGNC">           8 :     address oldRateStrategyAddress = reserve.interestRateStrategyAddress;</span></span>
<span id="L565"><span class="lineNum">     565</span>                 :             : </span>
<span id="L566"><span class="lineNum">     566</span>                 :<span class="tlaGNC">           8 :     _pool.syncIndexesState(asset);</span></span>
<span id="L567"><span class="lineNum">     567</span>                 :             : </span>
<span id="L568"><span class="lineNum">     568</span>                 :<span class="tlaGNC">           8 :     IDefaultInterestRateStrategyV2(newRateStrategyAddress).setInterestRateParams(asset, rateData);</span></span>
<span id="L569"><span class="lineNum">     569</span>                 :<span class="tlaGNC">           8 :     emit ReserveInterestRateDataChanged(asset, newRateStrategyAddress, rateData);</span></span>
<span id="L570"><span class="lineNum">     570</span>                 :             : </span>
<span id="L571"><span class="lineNum">     571</span>                 :<span class="tlaGNC">           8 :     if (oldRateStrategyAddress != newRateStrategyAddress) {</span></span>
<span id="L572"><span class="lineNum">     572</span>                 :<span class="tlaGNC">           8 :       _pool.setReserveInterestRateStrategyAddress(asset, newRateStrategyAddress);</span></span>
<span id="L573"><span class="lineNum">     573</span>                 :<span class="tlaGNC">           8 :       emit ReserveInterestRateStrategyChanged(</span></span>
<span id="L574"><span class="lineNum">     574</span>                 :             :         asset,</span>
<span id="L575"><span class="lineNum">     575</span>                 :             :         oldRateStrategyAddress,</span>
<span id="L576"><span class="lineNum">     576</span>                 :             :         newRateStrategyAddress</span>
<span id="L577"><span class="lineNum">     577</span>                 :             :       );</span>
<span id="L578"><span class="lineNum">     578</span>                 :             :     }</span>
<span id="L579"><span class="lineNum">     579</span>                 :             : </span>
<span id="L580"><span class="lineNum">     580</span>                 :<span class="tlaGNC">           8 :     _pool.syncRatesState(asset);</span></span>
<span id="L581"><span class="lineNum">     581</span>                 :             :   }</span>
<span id="L582"><span class="lineNum">     582</span>                 :             : </span>
<span id="L583"><span class="lineNum">     583</span>                 :<span class="tlaGNC">        1774 :   function _checkNoSuppliers(address asset) internal view {</span></span>
<span id="L584"><span class="lineNum">     584</span>                 :<span class="tlaGNC">        5322 :     DataTypes.ReserveDataLegacy memory reserveData = _pool.getReserveData(asset);</span></span>
<span id="L585"><span class="lineNum">     585</span>                 :<span class="tlaGNC">        5322 :     uint256 totalSupplied = IPoolDataProvider(_addressesProvider.getPoolDataProvider())</span></span>
<span id="L586"><span class="lineNum">     586</span>                 :             :       .getATokenTotalSupply(asset);</span>
<span id="L587"><span class="lineNum">     587</span>                 :             : </span>
<span id="L588"><span class="lineNum">     588</span>                 :<span class="tlaGNC">        3548 :     require(</span></span>
<span id="L589"><span class="lineNum">     589</span>                 :             :       totalSupplied == 0 &amp;&amp; reserveData.accruedToTreasury == 0,</span>
<span id="L590"><span class="lineNum">     590</span>                 :             :       Errors.RESERVE_LIQUIDITY_NOT_ZERO</span>
<span id="L591"><span class="lineNum">     591</span>                 :             :     );</span>
<span id="L592"><span class="lineNum">     592</span>                 :             :   }</span>
<span id="L593"><span class="lineNum">     593</span>                 :             : </span>
<span id="L594"><span class="lineNum">     594</span>                 :<span class="tlaGNC">           3 :   function _checkNoBorrowers(address asset) internal view {</span></span>
<span id="L595"><span class="lineNum">     595</span>                 :<span class="tlaGNC">           9 :     uint256 totalDebt = IPoolDataProvider(_addressesProvider.getPoolDataProvider()).getTotalDebt(</span></span>
<span id="L596"><span class="lineNum">     596</span>                 :             :       asset</span>
<span id="L597"><span class="lineNum">     597</span>                 :             :     );</span>
<span id="L598"><span class="lineNum">     598</span>                 :<span class="tlaGNC">           6 :     require(totalDebt == 0, Errors.RESERVE_DEBT_NOT_ZERO);</span></span>
<span id="L599"><span class="lineNum">     599</span>                 :             :   }</span>
<span id="L600"><span class="lineNum">     600</span>                 :             : </span>
<span id="L601"><span class="lineNum">     601</span>                 :<span class="tlaGNC">        1256 :   function _onlyPoolAdmin() internal view {</span></span>
<span id="L602"><span class="lineNum">     602</span>                 :<span class="tlaGNC">        3768 :     IACLManager aclManager = IACLManager(_addressesProvider.getACLManager());</span></span>
<span id="L603"><span class="lineNum">     603</span>                 :<span class="tlaGNC">        2512 :     require(aclManager.isPoolAdmin(msg.sender), Errors.CALLER_NOT_POOL_ADMIN);</span></span>
<span id="L604"><span class="lineNum">     604</span>                 :             :   }</span>
<span id="L605"><span class="lineNum">     605</span>                 :             : </span>
<span id="L606"><span class="lineNum">     606</span>                 :<span class="tlaUNC tlaBgUNC">           0 :   function _onlyEmergencyAdmin() internal view {</span></span>
<span id="L607"><span class="lineNum">     607</span>                 :<span class="tlaUNC">           0 :     IACLManager aclManager = IACLManager(_addressesProvider.getACLManager());</span></span>
<span id="L608"><span class="lineNum">     608</span>                 :<span class="tlaUNC">           0 :     require(aclManager.isEmergencyAdmin(msg.sender), Errors.CALLER_NOT_EMERGENCY_ADMIN);</span></span>
<span id="L609"><span class="lineNum">     609</span>                 :             :   }</span>
<span id="L610"><span class="lineNum">     610</span>                 :             : </span>
<span id="L611"><span class="lineNum">     611</span>                 :<span class="tlaGNC tlaBgGNC">       14903 :   function _onlyPoolOrEmergencyAdmin() internal view {</span></span>
<span id="L612"><span class="lineNum">     612</span>                 :<span class="tlaGNC">       44709 :     IACLManager aclManager = IACLManager(_addressesProvider.getACLManager());</span></span>
<span id="L613"><span class="lineNum">     613</span>                 :<span class="tlaGNC">       29806 :     require(</span></span>
<span id="L614"><span class="lineNum">     614</span>                 :             :       aclManager.isPoolAdmin(msg.sender) || aclManager.isEmergencyAdmin(msg.sender),</span>
<span id="L615"><span class="lineNum">     615</span>                 :             :       Errors.CALLER_NOT_POOL_OR_EMERGENCY_ADMIN</span>
<span id="L616"><span class="lineNum">     616</span>                 :             :     );</span>
<span id="L617"><span class="lineNum">     617</span>                 :             :   }</span>
<span id="L618"><span class="lineNum">     618</span>                 :             : </span>
<span id="L619"><span class="lineNum">     619</span>                 :<span class="tlaGNC">        2592 :   function _onlyAssetListingOrPoolAdmins() internal view {</span></span>
<span id="L620"><span class="lineNum">     620</span>                 :<span class="tlaGNC">        7776 :     IACLManager aclManager = IACLManager(_addressesProvider.getACLManager());</span></span>
<span id="L621"><span class="lineNum">     621</span>                 :<span class="tlaGNC">        5184 :     require(</span></span>
<span id="L622"><span class="lineNum">     622</span>                 :             :       aclManager.isAssetListingAdmin(msg.sender) || aclManager.isPoolAdmin(msg.sender),</span>
<span id="L623"><span class="lineNum">     623</span>                 :             :       Errors.CALLER_NOT_ASSET_LISTING_OR_POOL_ADMIN</span>
<span id="L624"><span class="lineNum">     624</span>                 :             :     );</span>
<span id="L625"><span class="lineNum">     625</span>                 :             :   }</span>
<span id="L626"><span class="lineNum">     626</span>                 :             : </span>
<span id="L627"><span class="lineNum">     627</span>                 :<span class="tlaGNC">       24323 :   function _onlyRiskOrPoolAdmins() internal view {</span></span>
<span id="L628"><span class="lineNum">     628</span>                 :<span class="tlaGNC">       72969 :     IACLManager aclManager = IACLManager(_addressesProvider.getACLManager());</span></span>
<span id="L629"><span class="lineNum">     629</span>                 :<span class="tlaGNC">       48646 :     require(</span></span>
<span id="L630"><span class="lineNum">     630</span>                 :             :       aclManager.isRiskAdmin(msg.sender) || aclManager.isPoolAdmin(msg.sender),</span>
<span id="L631"><span class="lineNum">     631</span>                 :             :       Errors.CALLER_NOT_RISK_OR_POOL_ADMIN</span>
<span id="L632"><span class="lineNum">     632</span>                 :             :     );</span>
<span id="L633"><span class="lineNum">     633</span>                 :             :   }</span>
<span id="L634"><span class="lineNum">     634</span>                 :             : </span>
<span id="L635"><span class="lineNum">     635</span>                 :<span class="tlaGNC">        1011 :   function _onlyRiskOrPoolOrEmergencyAdmins() internal view {</span></span>
<span id="L636"><span class="lineNum">     636</span>                 :<span class="tlaGNC">        3033 :     IACLManager aclManager = IACLManager(_addressesProvider.getACLManager());</span></span>
<span id="L637"><span class="lineNum">     637</span>                 :<span class="tlaGNC">        2022 :     require(</span></span>
<span id="L638"><span class="lineNum">     638</span>                 :             :       aclManager.isRiskAdmin(msg.sender) ||</span>
<span id="L639"><span class="lineNum">     639</span>                 :             :         aclManager.isPoolAdmin(msg.sender) ||</span>
<span id="L640"><span class="lineNum">     640</span>                 :             :         aclManager.isEmergencyAdmin(msg.sender),</span>
<span id="L641"><span class="lineNum">     641</span>                 :             :       Errors.CALLER_NOT_RISK_OR_POOL_OR_EMERGENCY_ADMIN</span>
<span id="L642"><span class="lineNum">     642</span>                 :             :     );</span>
<span id="L643"><span class="lineNum">     643</span>                 :             :   }</span>
<span id="L644"><span class="lineNum">     644</span>                 :             : }</span>
        </pre>
              </td>
            </tr>
          </table>
          <br>

          <table width="100%" border=0 cellspacing=0 cellpadding=0>
            <tr><td class="ruler"><img src="../../../../../../../../../glass.png" width=3 height=3 alt=""></td></tr>
            <tr><td class="versionInfo">Generated by: <a href="https://github.com//linux-test-project/lcov" target="_parent">LCOV version 2.0-1</a></td></tr>
          </table>
          <br>

</body>
</html>
